import BaseController from '../../../base/base-controller';
import { Get, Prefix, Render, Post } from 'egg-shell-decorators';
import LoginService from '../../../service/login/login/login-service'

@Prefix('/')
export default class LoginController extends BaseController {

    private readonly loginService: LoginService = this.ctx.service.login.login.loginService

    @Render
    @Get('login')
    public async loginPage(): Promise<any> {
        await this.loginService.login()
        await this.ctx.render('login/login/frame.njk',{entrance: 'login/login'})
    }

    @Post('login')
    public async loginJson(): Promise<any> {
        await this.loginService.login()
    }
}
